<template>
	<view>
		<swiper :autoplay="autoplay" :interval="interval" circular @touchstart="stopAutoplay" @touchend="startAutoplay"
			class="scroll_list" :vertical="true">
			<swiper-item v-for="(item, index) in list" :key="index">
				<view class="rows list-item f-r-b">
					<text class="tr1 ellipsis">{{item.productName}}</text>
					<view class="tr2 f-r-e f-r-nw" :style="{'color':item.biliType==1?'red':item.biliType==2?'green':themeColor}">
					
						<text>{{item.productPrice !=null? item.productPrice.toFixed(1):0.0}}</text>
						<view style="margin: 0 10rpx;">
							<uni-icons v-if="item.biliType==1" type="arrow-up" size="18" color="red"></uni-icons>
							<uni-icons v-else-if="item.biliType==2" type="arrow-down" size="18" color="green"></uni-icons>
							<text v-else> - </text>
						</view>
						<text>{{item.biliPrice !=null? item.biliPrice.toFixed(1):0.0}}</text>
						
					</view>
				</view>
			</swiper-item>

		</swiper>
	</view>
</template>

<script>
	export default {
		props: {
			interval: {
				type: Number,
				default: 3000,
			},
			list: {
				type: Array,
				default: [],
			}
		},
		computed: {
			themeColor() {
				return this.$themeColor;
			}
		},
		data() {
			return {
				autoplay: true,

			};
		},
		methods: {
			stopAutoplay() {
				this.autoplay = false;
			},
			startAutoplay() {
				this.autoplay = true;
			}
		}
	}
</script>

<style lang="less" scoped>
	.scroll_list {
		height: 80rpx;
		background: #fff;
		padding: 0 10rpx;

		.rows {
			height: 40rpx;
			margin: 20rpx 0;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			font-size: 27rpx;

			.tr1 {
				width: 150rpx;
				text-align: left;
			}

			.tr2 {
				flex: 1;
				text-align: right;
				overflow: hidden;


			}
		}
		
		
	}
</style>